set(CMAKE_CXX_STANDARD 14)

message("3RD_LIB_OUTPATH: " ${LIB_3RD_OUTPUT_PATH})
if(NOT EXISTS "${LIB_3RD_OUTPUT_PATH}")
    set(LIB_OUT_DIR ${LIBRARY_OUTPUT_PATH})
    set(LIBRARY_OUTPUT_PATH ${LIB_3RD_OUTPUT_PATH})

    add_subdirectory(3rd/geos)
    # log4cplus日志库
    add_subdirectory(3rd/log4cplus)

    set(LIBRARY_OUTPUT_PATH ${LIB_OUT_DIR})
    unset(LIB_OUT_DIR)
endif()


add_subdirectory(osapi)

set(SOURCE_CODE
        algorithm/vdr_config.cpp
        algorithm/SensorDataCache.cpp
        algorithm/SensorDataCache.hpp
        algorithm/StaticStateDetection.cpp
        algorithm/StaticStateDetection.hpp
        algorithm/TransformCoordinate.cpp
        algorithm/TransformCoordinate.hpp

        common/log/vdr_log.cpp
        common/log/vdr_log.cpp
        common/log/log4cplus_impl.hpp
        common/log/log4cplus_impl.cpp
        common/ut_string.cpp
        common/ut_algorithm.cpp
        common/ut_coordinates.cpp
        common/ut_signal_format.cpp
        common/ut_signal_format.hpp
        common/visual/visual_tools.cpp
        common/visual/visual_tools.h

        engine/ILocSignalDeliver.hpp
        engine/LocSignalDeliverChainBuilder.hpp
        engine/LocSignalDeliverChainBuilder.cpp
        engine/LocSignalDeliverFactory.hpp
        engine/LocSignalDeliverFactory.cpp
        engine/LocSignalDeliverManager.hpp
        engine/LocSignalDeliverManager.cpp
        engine/VDREngine.hpp
        engine/VDREngine.cpp
        algorithm/NaviAttitudeTools.cpp
        algorithm/NaviAttitudeTools.hpp
        algorithm/NaviEarthTools.cpp
        algorithm/NaviEarthTools.hpp
        algorithm/NaviConstant.h
        algorithm/NaviData.h
        algorithm/NaviData.cpp
        algorithm/simpleRtk.hpp
        algorithm/ESKFFusionSimple.cpp
        algorithm/ESKFFusionSimple.hpp
        algorithm/NaviFusionImpl.hpp
        algorithm/NaviFusionImpl.cpp
)

message("SOURCE_CODE: " ${SOURCE_CODE})

add_library(vdr STATIC ${SOURCE_CODE})

target_link_libraries(vdr PRIVATE geos log4cplus osapi)